﻿function PerformanceHolder() {

    this.shutdownTimes = [];
    this.collistionTimes = [];
    this.fireTimes = [];

    this.numOfShootDown = 0;
    this.numOfCollision = 0;
    this.numOfFirePressed = 0;


    this.onMeteorShootDown = function (currentTime) {
        this.numOfShootDown++;
        this.shutdownTimes.push(currentTime);
    }

    this.onMeteorCollision = function (currentTime) {
        this.collistionTimes.push(currentTime);
        this.numOfCollision++;
    }

    this.onFirePressed = function (currentTime) {
        this.numOfFirePressed++;
        this.fireTimes.push(currentTime);
    }

    this.getPerformanceDataOfLastSession = function () {
        content = {
            totalSd: this.numOfShootDown,
            totalCl: this.numOfCollision,
            totalFire: this.numOfFirePressed,
            sessionSd: this.shutdownTimes.length,
            sessionCl: this.collistionTimes.length,
            sessionFire: this.fireTimes.length,
            shutdownTimes: this.shutdownTimes,
            collistionTimes: this.collistionTimes,
            fireTimes: this.fireTimes
        };
        this.shutdownTimes = [];
        this.collistionTimes = [];
        this.fireTimes = [];
        return content;
    }
}